//封装banner轮播图相关的业务代码
//把独立的业务逻辑封装到函数内部
import { ref, onMounted } from 'vue'
import { getBannerAPI } from '@/apis/home'
export function useBanner() {
  //渲染分类里的banner
  const bannerList = ref([])
  const getBanner = async () => {
    const res = await getBannerAPI({
      distributionSite: '2'
    })
    bannerList.value = res.result
    console.log(res)
  }

  onMounted(() => { getBanner() })

  //把需要的数据返回出去
  return{
    bannerList
  }

}